//
//  NavigationController.m
//  CarLifes
//
//  Created by yu on 2017/6/14.
//  Copyright © 2017年 jpas. All rights reserved.
//

#import "NavigationController.h"
#import "UIBarButtonItem+CLItem.h"

@interface NavigationController ()

@end

@implementation NavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    self.navigationBar.layer.shadowColor = [UIColor blackColor].CGColor;
//    
//    //2.设置阴影偏移范围
//    self.navigationBar.layer.shadowOffset = CGSizeMake(0, 10);
//    
//    //3.设置阴影颜色的透明度
//    self.navigationBar.layer.shadowOpacity = 0.2;
//    
//    //4.设置阴影半径
//    self.navigationBar.layer.shadowRadius = 16;
//    
//    //5.设置阴影路径
//    self.navigationBar.layer.shadowPath = [UIBezierPath bezierPathWithRect:self.navigationController.navigationBar.bounds].CGPath;
}

- (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated{
    if(self.childViewControllers.count > 0) {
        viewController.hidesBottomBarWhenPushed = YES;
        viewController.navigationItem.leftBarButtonItem = [UIBarButtonItem barButtonItemWithImage:[UIImage imageNamed:@"back_white"] target:self action:@selector(returnAction) forControlEvents:UIControlEventTouchUpInside];
    }
    [super pushViewController:viewController animated:animated];
}

#pragma mark - 返回
- (void)returnAction {
    [self popViewControllerAnimated:YES];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
